{extend name="base" /} {block name="body"}
{block name="css"}
	<link rel="stylesheet" href="/public/oem/css/iconfont.css" />
	<link rel="stylesheet" href="/public/oem/css/css.css" />
{/block}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="layui-this">合伙人订货管理</li>
		</ul>
		<div class="layui-tab-content">
			<form class="layui-form layui-form-pane" action="{:url('member/pt_dinghuo')}" method="get">
				<div class="layui-inline">
					<label class="layui-form-label">关键词</label>
					<div class="layui-input-inline">
						<input type="text" name="keyword" value="{$keyword}" placeholder="请输入关键词" class="layui-input">
					</div>
				</div>
				<div class="layui-inline">
					<select name="ziduan">
						<option value="nick_name" {if $ziduan=='nick_name' }selected{/if}>订货人</option>
						<option value="mobile" {if $ziduan=='mobile' }selected{/if}>手机号</option>
					</select>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">状态</label>
					<div class="layui-input-inline">
					      <select name="status"   class="layui-input">
					        <option value=""></option>
							<option value="1">待审核</option>
							<option value="2">已发货</option>
							<option value="3">已收货</option>
							<option value="4">已关闭</option>
					      </select>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">排序</label>
					<div class="layui-input-inline">
						<select name="param">
							<option value="add_time" {if $param=='add_time' }selected{/if}>申请时间</option>
						</select>
					</div>
				</div>
				<div class="layui-inline">
					<select name="sort">
						<option value="asc" {if $sort=='asc' }selected{/if}>从低到高</option>
						<option value="desc" {if $sort=='desc' }selected{/if}>从高到底</option>
					</select>
				</div>
				<div class="layui-inline">
					<button class="layui-btn">搜索</button>
				</div>
			</form>
			<hr>
			<table class="layui-table">
				<thead>
					<tr>
						<th>ID</th>
						<th>账号(手机号)</th>
						<th>订货人</th>
						<th>商品名称</th>
						<th>商品数量</th>
						<th>金额</th>
						<th>申请时间</th>
						<th>付款凭证</th>
						<th>收货地址</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					{foreach name="dinghuo_list" item="vo"}
					<tr>
						<td>{$vo.id}</td>
						<td>{$vo.mobile}</td>
						<td>{$vo.name}</td>
						<th>{$vo.money}</th>
						<td>{$vo.goods_name}</td>
						<td>{$vo.nums}</td>
						<td>{$vo.add_time}</td>
						<td><img src="{$vo.pz}" style="width:180px;"/></td>
						<td>{$vo.address}</td>
						<td>
							{if $vo.status==1}
							待审核
							{elseif $vo.status==2}
							已发货
							{elseif $vo.status==3}
							已收货
							{else/}
							已关闭
							{/if}
						</td>
						<td>
							<a href="#" onclick="record({$vo.id})" class="layui-btn layui-btn-danger layui-btn-small ">详情</a>
						</td>
					</tr>
					{/foreach}
				</tbody>
			</table>
			<!--分页-->
			{$dinghuo_list->render()}
		</div>
	</div>
</div>
{/block}
{block name="js"}

<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/pt_dinghuo"
	};
</script>
<script>	
	function record(id) {
		var url = 'dinghuo_info?id=' + id;
		layer.open({
			type: 2,
			title: '订货详情',
			shadeClose: true,
			shade: 0.8,
			area: ['775px', '650px'],
			content: [url]
		});
	}
</script>
{/block}